package com.itheima.stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class Demo04 {

    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            list.add(i+1);
        }
        List<Integer> result = list.stream().filter(integer -> integer % 2 == 0).collect(Collectors.toList());
        System.out.println(result);

    }
}
